package com.journey.action;

import com.journey.iService.IUserInfoService;
import com.journey.model.UserInfo;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("all")
public class LoginAction extends ActionSupport {
    private IUserInfoService userInfoService;
	private String username;
	private String password;

	public IUserInfoService getUserInfoService() {
		return userInfoService;
	}


	public void setUserInfoService(IUserInfoService userInfoService) {
		this.userInfoService = userInfoService;
	}


	public String getUsername() {
		return username;
	}


	public void setUsername(String username) {
		this.username = username;
	}


	public String getPassword() {
		return password;
	}


	public void setPassword(String password) {
		this.password = password;
	}


	public String execute() throws Exception {
		UserInfo user=new UserInfo();
		user.setUsername(username);
		user.setPassword(password);
		
		if(userInfoService.Login(user)){
			return SUCCESS;
		}else{
			return INPUT;
		}
		
	}

}
